home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Games / MAME / src / drivers / nova2001.c < prev    next >
C/C++ Source or Header  |  2000-05-04  |  10KB  |  288 lines

  1. /*******************************************************************************
  2.  
  3.      Nova 2001 - by UPL - 1983
  4.  
  5.      driver by Howie Cohen, Frank Palazzolo, Alex Pasadyn
  6.  
  7.      Memory Map:
  8.  
  9.      Address Range:     R/W:     Function:
  10.      --------------------------------------------------------------------------
  11.      0000 - 7fff        R        Program ROM (7000-7fff mirror of 6000-6fff)
  12.      a000 - a3ff        R/W      Foreground Playfield character RAM
  13.      a400 - a7ff        R/W      Foreground Playfield color modifier RAM
  14.      a800 - abff        R/W      Scrolling Playfield character RAM
  15.      ac00 - a7ff        R/W      Scrolling Playfield color modifier RAM
  16.      b000 - b7ff        R/W      Sprite RAM
  17.      bfff               W        flip screen
  18.      c000               R/W      AY8910 #1 Data R/W
  19.      c001               R/W      AY8910 #2 Data R/W
  20.      c002               W        AY8910 #1 Control W
  21.      c003               W        AY8910 #2 Control W
  22.      c004               R        Interrupt acknowledge / Watchdog reset
  23.      c006               R        Player 1 Controls
  24.      c007               R        Player 2 Controls
  25.      c00e               R        Coin Inputs, etc.
  26.      e000 - e7ff        R/W      Work RAM
  27.  
  28. *******************************************************************************/
  29.  
  30. #include "driver.h"
  31. #include "vidhrdw/generic.h"
  32.  
  33. /* From vidhrdw/nova2001.c */
  34. extern unsigned char *nova2001_videoram,*nova2001_colorram;
  35. extern size_t nova2001_videoram_size;
  36.  
  37. void nova2001_vh_convert_color_prom(unsigned char *palette, unsigned short *colortable,const unsigned char *color_prom);
  38. WRITE_HANDLER( nova2001_scroll_x_w );
  39. WRITE_HANDLER( nova2001_scroll_y_w );
  40. WRITE_HANDLER( nova2001_flipscreen_w );
  41. void nova2001_vh_screenrefresh(struct osd_bitmap *bitmap,int full_refresh);
  42.  
  43.  
  44.  
  45. static struct MemoryReadAddress readmem[] =
  46. {
  47.     { 0x0000, 0x7fff, MRA_ROM },
  48.     { 0xa000, 0xb7ff, MRA_RAM },
  49.     { 0xc000, 0xc000, AY8910_read_port_0_r },
  50.     { 0xc001, 0xc001, AY8910_read_port_1_r },
  51.     { 0xc004, 0xc004, watchdog_reset_r },
  52.     { 0xc006, 0xc006, input_port_0_r },
  53.     { 0xc007, 0xc007, input_port_1_r },
  54.     { 0xc00e, 0xc00e, input_port_2_r },
  55.     { 0xe000, 0xe7ff, MRA_RAM },
  56.     { -1 }    /* end of table */
  57. };
  58.  
  59.  
  60. static struct MemoryWriteAddress writemem[] =
  61. {
  62.     { 0x0000, 0x7fff, MWA_ROM },
  63.     { 0xa000, 0xa3ff, MWA_RAM, &nova2001_videoram, &nova2001_videoram_size },
  64.     { 0xa400, 0xa7ff, MWA_RAM, &nova2001_colorram },
  65.     { 0xa800, 0xabff, videoram_w, &videoram, &videoram_size },
  66.     { 0xac00, 0xafff, colorram_w, &colorram },
  67.     { 0xb000, 0xb7ff, MWA_RAM, &spriteram, &spriteram_size },
  68.     { 0xbfff, 0xbfff, nova2001_flipscreen_w },
  69.     { 0xc000, 0xc000, AY8910_write_port_0_w },
  70.     { 0xc001, 0xc001, AY8910_write_port_1_w },
  71.     { 0xc002, 0xc002, AY8910_control_port_0_w },
  72.     { 0xc003, 0xc003, AY8910_control_port_1_w },
  73.     { 0xe000, 0xe7ff, MWA_RAM },
  74.     { -1 }    /* end of table */
  75. };
  76.  
  77.  
  78.  
  79. INPUT_PORTS_START( nova2001 )
  80.     PORT_START
  81.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP | IPF_8WAY )
  82.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN | IPF_8WAY )
  83.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT | IPF_8WAY )
  84.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY )
  85.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
  86.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
  87.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 )
  88.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 )
  89.  
  90.     PORT_START    /* player 2 controls */
  91.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP | IPF_8WAY | IPF_COCKTAIL )
  92.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN | IPF_8WAY | IPF_COCKTAIL )
  93.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT | IPF_8WAY | IPF_COCKTAIL )
  94.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_COCKTAIL )
  95.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
  96.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
  97.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_COCKTAIL )
  98.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_COCKTAIL )
  99.  
  100.     PORT_START
  101.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
  102.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START1 )
  103.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START2 )
  104.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
  105.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
  106.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
  107.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
  108.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
  109.  
  110.     PORT_START  /* dsw0 */
  111.     PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
  112.     PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
  113.     PORT_DIPSETTING(    0x01, DEF_STR( Cocktail ) )
  114.     PORT_DIPNAME( 0x02, 0x02, DEF_STR( Lives ) )
  115.     PORT_DIPSETTING(    0x02, "3" )
  116.     PORT_DIPSETTING(    0x00, "4" )
  117.     PORT_DIPNAME( 0x04, 0x04, "1st Bonus Life" )
  118.     PORT_DIPSETTING(    0x04, "20000" )
  119.     PORT_DIPSETTING(    0x00, "30000" )
  120.     PORT_DIPNAME( 0x18, 0x18, "Extra Bonus Life" )
  121.     PORT_DIPSETTING(    0x18, "60000" )
  122.     PORT_DIPSETTING(    0x10, "70000" )
  123.     PORT_DIPSETTING(    0x08, "90000" )
  124.     PORT_DIPSETTING(    0x00, "None" )
  125.     PORT_DIPNAME( 0x60, 0x60, DEF_STR( Coinage ) )
  126.     PORT_DIPSETTING(    0x40, DEF_STR( 2C_1C ) )
  127.     PORT_DIPSETTING(    0x00, DEF_STR( 2C_2C ) )
  128.     PORT_DIPSETTING(    0x60, DEF_STR( 1C_1C ) )
  129.     PORT_DIPSETTING(    0x20, DEF_STR( 1C_2C ) )
  130.     PORT_DIPNAME( 0x80, 0x80, DEF_STR( Free_Play ) )
  131.     PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
  132.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  133.  
  134.     PORT_START  /* dsw1 */
  135.     PORT_DIPNAME( 0x03, 0x00, DEF_STR( Difficulty ) )
  136.     PORT_DIPSETTING(    0x00, "Easy" )
  137.     PORT_DIPSETTING(    0x03, "Medium" )
  138.     PORT_DIPSETTING(    0x02, "Hard" )
  139.     PORT_DIPSETTING(    0x01, "Hardest" )
  140.     PORT_DIPNAME( 0x04, 0x00, DEF_STR( Demo_Sounds ) )
  141.     PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
  142.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  143.     PORT_DIPNAME( 0x08, 0x08, "High Score Names" )
  144.     PORT_DIPSETTING(    0x00, "3 Letters" )
  145.     PORT_DIPSETTING(    0x08, "8 Letters" )
  146.     PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
  147.     PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
  148.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  149.     PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
  150.     PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
  151.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  152.     PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
  153.     PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
  154.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  155.     PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
  156. INPUT_PORTS_END
  157.  
  158.  
  159.  
  160. static struct GfxLayout charlayout =
  161. {
  162.     8,8,    /* 8*8 characters */
  163.     256,    /* 256 characters */
  164.     4,       /* 4 bits per pixel */
  165.     {0,1,2,3 }, /* the bitplanes are packed in one nibble */
  166.     {0, 4, 8192*8+0, 8192*8+4, 8, 12, 8192*8+8, 8192*8+12},
  167.     {16*0, 16*1, 16*2, 16*3, 16*4, 16*5, 16*6, 16*7},
  168.     8*16
  169. };
  170.  
  171. static struct GfxLayout spritelayout =
  172. {
  173.     16,16,    /* 16*16 characters */
  174.     64,    /* 64 sprites */
  175.     4,       /* 4 bits per pixel */
  176.     {0,1,2,3}, /* the bitplanes are packed in one nibble */
  177.     {0,  4,  8192*8+0,  8192*8+4,  8, 12,  8192*8+8, 8192*8+12,
  178.             16*8+0, 16*8+4, 16*8+8192*8+0, 16*8+8192*8+4, 16*8+8, 16*8+12, 16*8+8192*8+8, 16*8+8192*8+12},
  179.     {16*0, 16*1, 16*2, 16*3, 16*4, 16*5, 16*6, 16*7,
  180.             32*8+16*0, 32*8+16*1, 32*8+16*2, 32*8+16*3, 32*8+16*4, 32*8+16*5, 32*8+16*6, 32*8+16*7},
  181.     8*64
  182. };
  183.  
  184. static struct GfxDecodeInfo gfxdecodeinfo[] =
  185. {
  186.     { REGION_GFX1, 0x0000, &charlayout,       0, 16 },
  187.     { REGION_GFX2, 0x0000, &charlayout,   16*16, 16 },
  188.     { REGION_GFX1, 0x1000, &spritelayout,     0, 16 },
  189.     { REGION_GFX2, 0x1000, &spritelayout,     0, 16 },
  190.     { -1 } /* end of array */
  191. };
  192.  
  193.  
  194.  
  195. static struct AY8910interface ay8910_interface =
  196. {
  197.     2,    /* 2 chips */
  198.     6000000/3,    /* 2 MHz */
  199.     { 25, 25 },
  200.     { 0, input_port_3_r },
  201.     { 0, input_port_4_r },
  202.     { nova2001_scroll_x_w }, /* writes are connected to pf scroll */
  203.     { nova2001_scroll_y_w },
  204.     { 0 }
  205. };
  206.  
  207. static struct MachineDriver machine_driver_nova2001 =
  208. {
  209.     {
  210.         {
  211.             CPU_Z80,
  212.             3000000,    /* 3 MHz */
  213.             readmem,writemem,0,0,
  214.             interrupt,1
  215.         }
  216.     },
  217.     60, DEFAULT_REAL_60HZ_VBLANK_DURATION,    /* frames per second, vblank duration */
  218.     1,    /* single CPU, no need for interleaving */
  219.     0,
  220.  
  221.     32*8, 32*8, { 0*8, 32*8-1, 4*8, 28*8-1 },
  222.  
  223.     gfxdecodeinfo,
  224.     32,32*16,
  225.     nova2001_vh_convert_color_prom,
  226.  
  227.     VIDEO_TYPE_RASTER,
  228.     0,
  229.     generic_vh_start,
  230.     generic_vh_stop,
  231.     nova2001_vh_screenrefresh,
  232.  
  233.     0,0,0,0,
  234.     {
  235.         {
  236.             SOUND_AY8910,
  237.             &ay8910_interface
  238.         }
  239.     }
  240. };
  241.  
  242.  
  243.  
  244. ROM_START( nova2001 )
  245.     ROM_REGION( 0x10000, REGION_CPU1 )
  246.     ROM_LOAD( "1.6c",         0x0000, 0x2000, 0x368cffc0 )
  247.     ROM_LOAD( "2.6d",         0x2000, 0x2000, 0xbc4e442b )
  248.     ROM_LOAD( "3.6f",         0x4000, 0x2000, 0xb2849038 )
  249.     ROM_LOAD( "4.6g",         0x6000, 0x1000, 0x6b5bb12d )
  250.     ROM_RELOAD(               0x7000, 0x1000 )
  251.  
  252.     ROM_REGION( 0x4000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  253.     ROM_LOAD( "5.12s",        0x0000, 0x2000, 0x54198941 )
  254.     ROM_LOAD( "6.12p",        0x2000, 0x2000, 0xcbd90dca )
  255.  
  256.     ROM_REGION( 0x4000, REGION_GFX2 | REGIONFLAG_DISPOSE )
  257.     ROM_LOAD( "7.12n",        0x0000, 0x2000, 0x9ebd8806 )
  258.     ROM_LOAD( "8.12l",        0x2000, 0x2000, 0xd1b18389 )
  259.  
  260.     ROM_REGION( 0x0020, REGION_PROMS )
  261.     ROM_LOAD( "nova2001.clr", 0x0000, 0x0020, 0xa2fac5cd )
  262. ROM_END
  263.  
  264. ROM_START( nov2001u )
  265.     ROM_REGION( 0x10000, REGION_CPU1 )
  266.     ROM_LOAD( "nova2001.1",   0x0000, 0x2000, 0xb79461bd )
  267.     ROM_LOAD( "nova2001.2",   0x2000, 0x2000, 0xfab87144 )
  268.     ROM_LOAD( "3.6f",         0x4000, 0x2000, 0xb2849038 )
  269.     ROM_LOAD( "4.6g",         0x6000, 0x1000, 0x6b5bb12d )
  270.     ROM_RELOAD(               0x7000, 0x1000 )
  271.  
  272.     ROM_REGION( 0x4000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  273.     ROM_LOAD( "nova2001.5",   0x0000, 0x2000, 0x8ea576e8 )
  274.     ROM_LOAD( "nova2001.6",   0x2000, 0x2000, 0x0c61656c )
  275.  
  276.     ROM_REGION( 0x4000, REGION_GFX2 | REGIONFLAG_DISPOSE )
  277.     ROM_LOAD( "7.12n",        0x0000, 0x2000, 0x9ebd8806 )
  278.     ROM_LOAD( "8.12l",        0x2000, 0x2000, 0xd1b18389 )
  279.  
  280.     ROM_REGION( 0x0020, REGION_PROMS )
  281.     ROM_LOAD( "nova2001.clr", 0x0000, 0x0020, 0xa2fac5cd )
  282. ROM_END
  283.  
  284.  
  285.  
  286. GAME( 1983, nova2001, 0,        nova2001, nova2001, 0, ROT0, "UPL", "Nova 2001 (Japan)" )
  287. GAME( 1983, nov2001u, nova2001, nova2001, nova2001, 0, ROT0, "UPL (Universal license)", "Nova 2001 (US)" )
  288.